<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	template="/layout/template.xhtml">

	<ui:define name="body">

		<script type="text/javascript">  
	
		//home.xhtml de arama kısmında sonucların goruntulenmesinde kullanıldı
		function changeVisible(){
				jQuery("#labelInfo").fadeOut('slow',function() {
					jQuery("#textInfo").fadeIn('slow');
				});	
		}
		//home.xhtml de arama sonuclarının kapatılmasında kullanıldı
		function hideSearchPanel(){
			jQuery("#searchPanel").fadeOut('slow',function() {
					jQuery("#votes").fadeIn('slow');
			});
		}
			
	</script>
		<h:form prependId="false">
			<p:panel header="Account Details">
				<fieldset>
					<legend>Information</legend>
					<div id="labelInfo">
						<p:graphicImage value="#{loginBean.user.picNodeId == null ? '../img/user-photo64.jpg' : loginBean.user.picNodeId}" style="float:left;padding:15px;"></p:graphicImage>
						<h:panelGrid columns="2" style="margin-left:30px;text-align:left;"
							styleClass="panelGridClass">
							<h:outputLabel value="User Name" />
							<h:outputText value=": #{loginBean.user.userName}" />

							<h:outputLabel value="Password" />
							<h:outputText value=": #{loginBean.user.password}" />

							<h:outputLabel value="E-Mail" />
							<h:outputText value=": #{loginBean.user.email}" />

							<h:outputLabel value="Register Date" />
							<h:outputText value=": #{loginBean.user.registerDate}" />

						</h:panelGrid>
						<h:panelGrid columns="2"
							style="margin-top:30px;margin-left:30px;text-align:left;">
							<p:commandButton type="button" onclick="changeVisible();"
								value="Change" styleClass="customBlueButton"></p:commandButton>
							<p:commandButton action="home.xhtml?faces-redirect=true"
								value="Back to Home" styleClass="customGreyButton"></p:commandButton>
						</h:panelGrid>
					</div>
					<div id="textInfo" style="display: none">
						<h:panelGrid columns="2" style="margin-left:30px;text-align:left;"
							styleClass="panelGridClass">
							<h:outputLabel value="User Name" />
							<h:inputText value="#{loginBean.user.userName}" />

							<h:outputLabel value="Password" />
							<h:inputText value="#{loginBean.user.password}" />

							<h:outputLabel value="E-Mail" />
							<h:inputText value="#{loginBean.user.email}" />

						</h:panelGrid>
						<h:panelGrid columns="2"
							style="margin-top:30px;margin-left:30px;text-align:left;">
							<p:commandButton value="Update" action="#{loginBean.updateUser}"
								styleClass="customBlueButton"></p:commandButton>
							<p:commandButton action="home.xhtml?faces-redirect=true"
								value="Back to Home" styleClass="customGreyButton"></p:commandButton>
						</h:panelGrid>
					</div>
				</fieldset>
				<!--				<ui:decorate template="/layout/common/display.xhtml">-->
				<!--					<ui:define name="label">-->
				<!--						<h:outputLabel value="User Name" />-->
				<!--					</ui:define>-->
				<!--					<h:outputText value="#{loginBean.user.userName}" />-->
				<!--				</ui:decorate>-->
				<!--				<ui:decorate template="/layout/common/display.xhtml">-->
				<!--					<ui:define name="label">-->
				<!--						<h:outputLabel value="Password" />-->
				<!--					</ui:define>-->
				<!--					<h:outputText value="#{loginBean.user.password}" />-->
				<!--				</ui:decorate>-->
				<!--				<ui:decorate template="/layout/common/display.xhtml">-->
				<!--					<ui:define name="label">-->
				<!--						<h:outputLabel value="E-Mail" />-->
				<!--					</ui:define>-->
				<!--					<h:outputText value="#{loginBean.user.email}" />-->
				<!--				</ui:decorate>-->
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>


